{% extends 'book/base.html' %}
{% block title %}
    首页
{% endblock title %}
{% block content %}
    <table border="1" cellpadding="2" cellspacing="2" style="border-collapse:collapse">
        <thead>
            <tr align="center">
                <td>ID</td>
                <td>书名</td>
                <td>作者</td>
                <td>价格</td>
            </tr>
        </thead>
        <tbody>
        {% for book in books %}
            <tr align="center">
                <td><a href="{% url 'book_detail' book_id=book.id %}">{{ book.id }}</a></td>
                <td><a href="{% url 'book_detail' book_id=book.id %}">{{ book.name }}</a></td>
                <td>{{ book.author }}</td>
                <td>{{ book.price }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock content %}